﻿#include "outctrlitem.h"

OutCtrlItem::OutCtrlItem(QObject *parent) : QObject(parent)
{
    clean();
}

OutCtrlItem::~OutCtrlItem()
{
    clean();
}

OutCtrlItem::OutCtrlItem(const OutCtrlItem & item) : QObject()
{
    copyData(item);
}

OutCtrlItem & OutCtrlItem::operator= (const OutCtrlItem & item)
{
    copyData(item);
    return *this;
}

void OutCtrlItem::clean()
{
    m_macType = 0;
    m_showPriority = 0;
    m_name.clear();            // 名称
    m_def = -1;

    m_btn1Str.clear();
    m_btn1Visible = false;
    m_btn1ClickFun = -1;
    m_btn1PreFun = -1;
    m_btn1RelFun = -1;

    m_btn2Str.clear();
    m_btn2Visible = false;
    m_btn2ClickFun = -1;
    m_btn2PreFun = -1;
    m_btn2RelFun = -1;

    m_btn3Str.clear();
    m_btn3Visible = false;
    m_btn3ClickFun = -1;
    m_btn3PreFun = -1;
    m_btn3RelFun = -1;

    m_btn4Str.clear();
    m_btn4Visible = false;
    m_btn4ClickFun = -1;
    m_btn4PreFun = -1;
    m_btn4RelFun = -1;

    m_btn5Str.clear();
    m_btn5Visible = false;
    m_btn5ClickFun = -1;
    m_btn5PreFun = -1;
    m_btn5RelFun = -1;
}

void OutCtrlItem::copyData(const OutCtrlItem & item)
{
    if (this != &item)
    {
        this->m_macType       =   item.m_macType;
        this->m_showPriority  =   item.m_showPriority;
        this->m_name          =   item.m_name;    // 名称
        this->m_def           =   item.m_def;

        this->m_btn1Str       =   item.m_btn1Str;
        this->m_btn1Visible   =   item.m_btn1Visible;
        this->m_btn1ClickFun  =   item.m_btn1ClickFun;
        this->m_btn1PreFun    =   item.m_btn1PreFun;
        this->m_btn1RelFun    =   item.m_btn1RelFun;

        this->m_btn2Str       =   item.m_btn2Str;
        this->m_btn2Visible   =   item.m_btn2Visible;
        this->m_btn2ClickFun  =   item.m_btn2ClickFun;
        this->m_btn2PreFun    =   item.m_btn2PreFun;
        this->m_btn2RelFun    =   item.m_btn2RelFun;

        this->m_btn3Str       =   item.m_btn3Str;
        this->m_btn3Visible   =   item.m_btn3Visible;
        this->m_btn3ClickFun  =   item.m_btn3ClickFun;
        this->m_btn3PreFun    =   item.m_btn3PreFun;
        this->m_btn3RelFun    =   item.m_btn3RelFun;

        this->m_btn4Str       =   item.m_btn4Str;
        this->m_btn4Visible   =   item.m_btn4Visible;
        this->m_btn4ClickFun  =   item.m_btn4ClickFun;
        this->m_btn4PreFun    =   item.m_btn4PreFun;
        this->m_btn4RelFun    =   item.m_btn4RelFun;

        this->m_btn5Str       =   item.m_btn5Str;
        this->m_btn5Visible   =   item.m_btn5Visible;
        this->m_btn5ClickFun  =   item.m_btn5ClickFun;
        this->m_btn5PreFun    =   item.m_btn5PreFun;
        this->m_btn5RelFun    =   item.m_btn5RelFun;
    }
}
